﻿using System;
using ARS.Control.Factory;

namespace ARS.Control.Custom.DataPaging.Attributes
{
    /// <summary>
    /// basicmessage_ruleralation:实体类(属性说明自动提取数据库字段的描述信息)
    /// </summary>
    [Serializable]
    public class DataPagingDb
    {
        /// <summary>
        /// 获取DataPagingDb
        /// </summary>
        /// <param name="code"></param>
        /// <returns></returns>
        public static DataPagingDb GetModel(string code)
        {
            Interface.IUser user = UserFactory.CreateUser();
            string userId = user.GetUserInfo().Id.ToString();
            //获取datapaging model
            DataBase.Provider.IDataPagingProvider dataProvider = ARS.DataBase.Provider.DataPagingProvider.GetInstance();
            DataPagingDb dbModel;
            DataPagingQueryModel queryModel = new DataPagingQueryModel();
            queryModel.UserId = userId;
            queryModel.ClassName = code;
            dbModel = dataProvider.GetDataPagingDbModel(queryModel);
            return dbModel;
        }

        public DbSelect DbSelect
        {
            get;
            set;
        }

        public DbOperat DbOperat
        {
            get;
            set;
        }

        public HtmlTable HtmlTable
        {
            get;
            set;
        }

        public Operat Operat
        {
            get;
            set;
        }

        public Status Status
        {
            get;
            set;
        }

        public HtmlFanye HtmlFanye
        {
            get;
            set;
        }

        public DataPagingDb()
        {
            this.DbSelect = new DbSelect();
            this.HtmlTable = new HtmlTable();
            this.Operat = new Operat();
            this.DbOperat = new DbOperat();
            this.Status = new Status();
            this.HtmlFanye =new HtmlFanye();
        }
        

        public DataPagingDb(DbSelect dbSelect,HtmlTable htmlTable,Operat operat,DbOperat dbOperat,Status status,HtmlFanye htmlFanye)
        {
            this.DbSelect = dbSelect;
            this.HtmlTable = htmlTable;
            this.Operat = operat;
            this.DbOperat = dbOperat;
            this.Status = status;
            this.HtmlFanye = htmlFanye;
        }

        #region Entity

        private int _id;
        //private string _classname;
        //private string _dbselect_tablename;
        //private string _dbselect_selectfields;
        //private string _dbselect_orderfield;
        //private bool _dbselect_ordertype;
        //private int? _dbselect_pageindex;
        //private int? _dbselect_pagesize;
        //private string _dbselect_strwhere;
        //private string _dbselect_key;
        //private string _htmltable_tablecssname;
        //private string _htmltable_tbodytrhtml;
        //private string _htmltable_theadtrhtml;
        //private string _operat_operathtml;
        //private bool _operat_ishasoperat;
        //private string _operat_columnname;
        //private string _dboperat_deletesql;

        /// <summary>
        /// 
        /// </summary>
        public int Id
        {
            set { _id = value; }
            get { return _id; }
        }

        //public string Where_KeyValue
        //{
        //    get;
        //    set;
        //}

        //public int UserId
        //{
        //    set { Status.UserId = value; }
        //    get { return Status.UserId; }
        //}

        ///// <summary>
        ///// 
        ///// </summary>
        //public string ClassName
        //{
        //    set { Status.ClassName = value; }
        //    get { return Status.ClassName; }
        //}

        ///// <summary>
        ///// 
        ///// </summary>
        //public string DbSelect_TableName
        //{
        //    set { DbSelect.TableName = value; }
        //    get { return DbSelect.TableName; }
        //}

        ///// <summary>
        ///// 
        ///// </summary>
        //public string DbSelect_SelectFields
        //{
        //    set { DbSelect.SelectFields = value; }
        //    get { return DbSelect.SelectFields; }
        //}

        ///// <summary>
        ///// 
        ///// </summary>
        //public string DbSelect_OrderField
        //{
        //    set { DbSelect.OrderField = value; }
        //    get { return DbSelect.OrderField; }
        //}

        ///// <summary>
        ///// 
        ///// </summary>
        //public bool DbSelect_OrderType
        //{
        //    set { DbSelect.OrderType = value; }
        //    get { return DbSelect.OrderType; }
        //}

        ///// <summary>
        ///// 
        ///// </summary>
        //public int? DbSelect_PageIndex
        //{
        //    set { DbSelect.PageIndex = (int)value; }
        //    get { return DbSelect.PageIndex; }
        //}

        ///// <summary>
        ///// 
        ///// </summary>
        //public int? DbSelect_PageSize
        //{
        //    set { DbSelect.PageSize = (int)value; }
        //    get { return DbSelect.PageSize; }
        //}

        ///// <summary>
        ///// 
        ///// </summary>
        //public string DbSelect_StrWhere
        //{
        //    set { DbSelect.StrWhere = value; }
        //    get { return DbSelect.StrWhere; }
        //}

        ///// <summary>
        ///// 
        ///// </summary>
        //public string DbSelect_Key
        //{
        //    set { DbSelect.KeyField = value; }
        //    get { return DbSelect.KeyField; }
        //}

        ///// <summary>
        ///// 
        ///// </summary>
        //public string HtmlTable_TableCssName
        //{
        //    set { HtmlTable.TableCssName = value; }
        //    get { return HtmlTable.TableCssName; }
        //}

        ///// <summary>
        ///// 
        ///// </summary>
        //public string HtmlTable_TBodyTrHtml
        //{
        //    set { HtmlTable.TBodyTrHtml = value; }
        //    get { return HtmlTable.TBodyTrHtml; }
        //}

        ///// <summary>
        ///// 
        ///// </summary>
        //public string HtmlTable_THeadTrHtml
        //{
        //    set { HtmlTable.THeadTrHtml = value; }
        //    get { return HtmlTable.THeadTrHtml; }
        //}

        ///// <summary>
        ///// 
        ///// </summary>
        //public string Operat_OperatHtml
        //{
        //    set { Operat.OperatHtml = value; }
        //    get { return Operat.OperatHtml; }
        //}

        ///// <summary>
        ///// 
        ///// </summary>
        //public bool Operat_IsHasOperat
        //{
        //    set { Operat.IsHasOperat = value; }
        //    get { return Operat.IsHasOperat; }
        //}

        ///// <summary>
        ///// 
        ///// </summary>
        //public string Operat_ColumnName
        //{
        //    set { Operat.ColumnName = value; }
        //    get { return Operat.ColumnName; }
        //}

        ///// <summary>
        ///// 
        ///// </summary>
        //public string DbOperat_DeleteSql
        //{
        //    set { DbOperat.DeleteSql = value; }
        //    get { return DbOperat.DeleteSql; }
        //}

        #endregion Entity
    }
}
